<template>
  <el-checkbox
    v-bind="{ ...$attrs, value: Boolean(Number($attrs.value)) }"
    v-on="{ ...$listeners, change: handleChange }"
  >
    <slot></slot>
  </el-checkbox>
</template>

<script>
export default {
  name: "StringCheckbox",
  model: {
    prop: "value",
    event: "change",
  },
  methods: {
    handleChange(value, e) {
      value = String(Number(value));
      this.$emit("change", value, e);
    },
  },
};
</script>

<style lang="less" scoped></style>
